// 静态路由配置
// 书写格式与动态路由格式一致，全部经由框架统一转换
// 比较动态路由在meta中多加入了role角色权限，为数组类型。一个菜单是否有权限显示，取决于它以及后代菜单是否有权限。
// routes 显示在左侧菜单中的路由(显示顺序在动态路由之前)

const dashboardRoutes = [
    {
        "name": "home",
        "path": "/home",
        "meta": {
          "title": "首页",
          "icon": "el-icon-HomeFilled",
          "type": "menu",
          "collapse": true
        },
        "children": [
          {
            "name": "dashboard",
            "path": "/dashboard",
            "meta": {
              "title": "控制台",
              "icon": "el-icon-menu",
              "affix": true
            },
            "component": "dashboard"
          },
          {
            "name": "userCenter",
            "path": "/usercenter",
            "meta": {
              "title": "帐号信息",
              "icon": "el-icon-user",
              "tag": ""
            },
            "component": "userCenter"
          }
        ]
    },
]

const devRoutes = [
    {
        "name": "frame",
        "path": "/frame",
        "meta": {
            "title": "工具",
            "icon": "el-icon-mouse",
            "type": "menu"
        },
        "children": [
            {
                "name": "/frame/modules",
                "path": "modules",
                "meta": {
                    "title": "组件 Components",
                    "icon": "el-icon-takeaway-box",
                    "type": "menu"
                },
                "children": [
                    {
                        "path": "/frame/modules/iconfont",
                        "name": "iconfont",
                        "meta": {
                            "title": "扩展图标",
                            "type": "menu"
                        },
                        "component": "frame/modules/iconfont"
                    },
                    {
                        "path": "/frame/modules/mini",
                        "name": "mini",
                        "meta": {
                            "title": "原子组件",
                            "type": "menu"
                        },
                        "component": "frame/modules/mini"
                    },
                    {
                        "path": "/frame/modules/statistic",
                        "name": "statistic",
                        "meta": {
                            "title": "统计数值",
                            "type": "menu"
                        },
                        "component": "frame/modules/statistic"
                    },
                    {
                        "path": "/frame/modules/chart",
                        "name": "chart",
                        "meta": {
                            "title": "图标Chart",
                            "type": "menu"
                        },
                        "component": "frame/modules/chart"
                    },
                    {
                        "path": "/frame/modules/video",
                        "name": "video",
                        "meta": {
                            "title": "视频播放器",
                            "type": "menu"
                        },
                        "component": "frame/modules/video"
                    },
                    {
                        "path": "/frame/modules/qrcode",
                        "name": "qrcode",
                        "meta": {
                            "title": "二维码",
                            "type": "menu"
                        },
                        "component": "frame/modules/qrcode"
                    },
                ]
            },
            {
                "name": "from",
                "path": "/frame/from",
                "meta": {
                    "title": "表单 Form",
                    "icon": "el-icon-edit",
                    "type": "menu"
                },
                "children": [
                    {
                        "path": "/frame/from/tableselect",
                        "name": "tableselect",
                        "meta": {
                            "title": "表格选择器",
                            "type": "menu"
                        },
                        "component": "frame/from/tableselect"
                    },
                    {
                        "path": "/frame/from/formtable",
                        "name": "formtable",
                        "meta": {
                            "title": "表单表格",
                            "type": "menu"
                        },
                        "component": "frame/from/formtable"
                    },
                    {
                        "path": "/frame/from/verificate",
                        "name": "verificate",
                        "meta": {
                            "title": "表单验证",
                            "type": "menu"
                        },
                        "component": "frame/from/verificate"
                    },
                    {
                        "name": "formrender",
                        "path": "/frame/formrender",
                        "meta": {
                            "title": "动态表单",
                            //"icon": "el-icon-message-box",
                            "type": "menu"
                        },
                        "component": "frame/formrender"
                    },
                    {
                        "path": "/frame/from/iconselect",
                        "name": "iconselect",
                        "meta": {
                            "title": "图标选择器",
                            "type": "menu"
                        },
                        "component": "frame/from/iconselect"
                    },
                    {
                        "path": "/frame/from/selectFilter",
                        "name": "selectFilter",
                        "meta": {
                            "title": "分类筛选器",
                            "type": "menu"
                        },
                        "component": "frame/from/selectFilter"
                    },
                    {
                        "path": "/frame/from/filterbar",
                        "name": "filterbar",
                        "meta": {
                            "title": "数据过滤器",
                            "type": "menu"
                        },
                        "component": "frame/from/filterbar"
                    },
                    {
                        "path": "/frame/from/select",
                        "name": "select",
                        "meta": {
                            "title": "异步选择器",
                            "type": "menu"
                        },
                        "component": "frame/from/select"
                    },
                    {
                        "path": "/frame/from/upload",
                        "name": "upload",
                        "meta": {
                            "title": "数据上传",
                            "type": "menu"
                        },
                        "component": "frame/from/upload"
                    },
                    {
                        "path": "/frame/from/editor",
                        "name": "editor",
                        "meta": {
                            "title": "富文本编辑器",
                            "type": "menu"
                        },
                        "component": "frame/from/editor"
                    },
                    {
                        "path": "/frame/from/codeeditor",
                        "name": "codeeditor",
                        "meta": {
                            "title": "代码编辑器",
                            "type": "menu"
                        },
                        "component": "frame/from/codeeditor"
                    },
                    {
                        "path": "/frame/from/cropper",
                        "name": "cropper",
                        "meta": {
                            "title": "图像剪裁",
                            "type": "menu"
                        },
                        "component": "frame/from/cropper"
                    },
                ]
            },
            {
                "name": "table",
                "path": "/frame/table",
                "meta": {
                    "title": "表格 Table",
                    "icon": "el-icon-histogram",
                    "type": "menu"
                },
                "children": [
                    {
                        "path": "/frame/table/base",
                        "name": "base",
                        "meta": {
                            "title": "基础表格",
                            "type": "menu"
                        },
                        "component": "frame/table/base"
                    },
                    {
                        "path": "/frame/table/thead",
                        "name": "thead",
                        "meta": {
                            "title": "多级表头",
                            "type": "menu"
                        },
                        "component": "frame/table/thead"
                    },
                    {
                        "path": "/frame/table/column",
                        "name": "column",
                        "meta": {
                            "title": "动态列",
                            "type": "menu"
                        },
                        "component": "frame/table/column"
                    },
                    {
                        "path": "/frame/table/remote",
                        "name": "remote",
                        "meta": {
                            "title": "数据过滤",
                            "type": "menu"
                        },
                        "component": "frame/table/remote"
                    },
                ]
            },
            {
                "name": "template",
                "path": "/frame/template",
                "meta": {
                    "title": "模版 Template",
                    "icon": "el-icon-files",
                    "type": "menu"
                },
                "children": [
                    {
                        "path": "/frame/template/layout",
                        "name": "layoutTemplate",
                        "meta": {
                          "title": "布局",
                          "icon": "el-icon-grid",
                          "type": "menu"
                        },
                        "children": [
                          {
                            "path": "/frame/template/layout/blank",
                            "name": "blank",
                            "meta": {
                              "title": "空白模板",
                              "type": "menu"
                            },
                            "component": "frame/template/layout/blank"
                          },
                          {
                            "path": "/frame/template/layout/layoutTCB",
                            "name": "layoutTCB",
                            "meta": {
                              "title": "上中下布局",
                              "type": "menu"
                            },
                            "component": "frame/template/layout/layoutTCB"
                          },
                          {
                            "path": "/frame/template/layout/layoutLCR",
                            "name": "layoutLCR",
                            "meta": {
                              "title": "左中右布局",
                              "type": "menu"
                            },
                            "component": "frame/template/layout/layoutLCR"
                          }
                        ]
                      },
                      {
                        "path": "/frame/template/list",
                        "name": "list",
                        "meta": {
                          "title": "列表",
                          "icon": "el-icon-document",
                          "type": "menu"
                        },
                        "children": [
                          {
                            "path": "/frame/template/list/crud",
                            "name": "listCrud",
                            "meta": {
                              "title": "CRUD",
                              "type": "menu"
                            },
                            "component": "frame/template/list/crud",
                            "children": [
                              {
                                "path": "/frame/template/list/crud/detail/:id?",
                                "name": "listCrud-detail",
                                "meta": {
                                  "title": "新增/编辑",
                                  "hidden": true,
                                  "active": "/template/list/crud",
                                  "type": "menu"
                                },
                                "component": "frame/template/list/crud/detail"
                              }
                            ]
                          },
                          {
                            "path": "/frame/template/list/tree",
                            "name": "listTree",
                            "meta": {
                              "title": "左树右表",
                              "type": "menu"
                            },
                            "component": "frame/template/list/tree"
                          },
                          {
                            "path": "/frame/template/list/tab",
                            "name": "listTab",
                            "meta": {
                              "title": "分类表格",
                              "type": "menu"
                            },
                            "component": "frame/template/list/tab"
                          },
                          {
                            "path": "/frame/template/list/son",
                            "name": "listSon",
                            "meta": {
                              "title": "子母表",
                              "type": "menu"
                            },
                            "component": "frame/template/list/son"
                          },
                          {
                            "path": "/frame/template/list/widthlist",
                            "name": "widthlist",
                            "meta": {
                              "title": "定宽列表",
                              "type": "menu"
                            },
                            "component": "frame/template/list/width"
                          }
                        ]
                      },
                      {
                        "path": "/frame/template/other",
                        "name": "other",
                        "meta": {
                          "title": "更多",
                          "icon": "el-icon-folder",
                          "type": "menu"
                        },
                        "children": [
                            {
                                "path": "/frame/template/other/fileselect",
                                "name": "fileselect",
                                "meta": {
                                    "title": "资源管理",
                                    "type": "menu"
                                },
                                "component": "frame/template/other/fileselect"
                            },
                            {
                                "path": "/frame/template/other/stepform",
                                "name": "stepform",
                                "meta": {
                                  "title": "分步表单",
                                  "type": "menu"
                                },
                                "component": "frame/template/other/stepform"
                            },
                        ]
                      }
                ]
            },
            {
                "name": "other",
                "path": "/frame/other",
                "meta": {
                    "title": "其他 Other",
                    "icon": "el-icon-more-filled",
                    "type": "menu"
                },
                "children": [
                    {
                        "path": "/frame/other/dialog",
                        "name": "dialog",
                        "meta": {
                            "title": "弹窗扩展",
                            "type": "menu"
                        },
                        "component": "frame/other/dialog"
                    },
                    {
                        "path": "/frame/other/viewTags",
                        "name": "viewTags",
                        "meta": {
                            "title": "标签操作",
                            "type": "menu"
                        },
                        "component": "frame/other/viewTags"
                    },
                    {
                        "name": "workflow",
                        "path": "/frame/workflow",
                        "meta": {
                            "title": "工作流设计器",
                            //"icon": "el-icon-share",
                            "type": "menu"
                        },
                        "component": "frame/workflow"
                    },
                    {
                        "path": "/frame/other/importexport",
                        "name": "importexport",
                        "meta": {
                            "title": "文件导入导出",
                            "type": "menu"
                        },
                        "component": "frame/other/importexport"
                    },
                    {
                        "path": "/frame/other/cron",
                        "name": "cron",
                        "meta": {
                            "title": "Cron生成器",
                            "type": "menu"
                        },
                        "component": "frame/other/cron"
                    },
                    {
                        "path": "/frame/other/print",
                        "name": "print",
                        "meta": {
                            "title": "打印控件",
                            "type": "menu"
                        },
                        "component": "frame/other/print"
                    },
                    {
                        "path": "/frame/other/watermark",
                        "name": "watermark",
                        "meta": {
                            "title": "页面水印",
                            "type": "menu"
                        },
                        "component": "frame/other/watermark"
                    },
                    {
                        "path": "/frame/other/contextmenu",
                        "name": "contextmenu",
                        "meta": {
                            "title": "右键菜单",
                            "type": "menu"
                        },
                        "component": "frame/other/contextmenu"
                    },
                    {
                        "path": "/frame/other/drag",
                        "name": "drag",
                        "meta": {
                            "title": "拖拽排序",
                            "type": "menu"
                        },
                        "component": "frame/other/drag"
                    },
                    {
                        "path": "/frame/other/directive",
                        "name": "directive",
                        "meta": {
                            "title": "权限控制",
                            "type": "menu"
                        },
                        "component": "frame/other/directive"
                    },
                    {
                        "path": "/frame/other/loadJS",
                        "name": "loadJS",
                        "meta": {
                            "title": "异步加载JS",
                            "type": "menu"
                        },
                        "component": "frame/other/loadJS"
                    },
                    {
                        "path": "/frame/other/codebug",
                        "name": "codebug",
                        "meta": {
                            "title": "异常处理",
                            "type": "menu"
                        },
                        "component": "frame/other/codebug"
                    },
                    {
                        "path": "/link",
                        "name": "link",
                        "meta": {
                          "title": "外部链接",
                          "icon": "el-icon-link",
                          "type": "menu"
                        },
                        "children": [
                          {
                            "path": "http://baidu.com",
                            "name": "百度",
                            "meta": {
                              "title": "百度",
                              "type": "link"
                            }
                          },
                          {
                            "path": "https://www.google.cn",
                            "name": "谷歌",
                            "meta": {
                              "title": "谷歌",
                              "type": "link"
                            }
                          },
                        ]
                    },
                    {
                        "path": "/iframe",
                        "name": "Iframe",
                        "meta": {
                          "title": "Iframe",
                          "icon": "el-icon-position",
                          "type": "menu"
                        },
                        "children": [
                          {
                            "path": "https://v3.cn.vuejs.org",
                            "name": "vue3",
                            "meta": {
                              "title": "VUE 3",
                              "type": "iframe"
                            }
                          },
                          {
                            "path": "https://element-plus.gitee.io",
                            "name": "elementplus",
                            "meta": {
                              "title": "Element Plus",
                              "type": "iframe"
                            }
                          },
                        ]
                    },
                ]
            },
        ]
    },
]

// const userRoutes = [ 
//     {
//         "name": "system",
//         "path": "/system",
//         "meta": {
//           "title": "配置",
//           "icon": "el-icon-setting",
//           "type": "menu",
//           "collapse": true
//         },
//         "children": [
//           {
//             "path": "/system/config",
//             "name": "config",
//             "meta": {
//               "title": "系统设置",
//               "icon": "el-icon-tools",
//               "type": "menu",
//               //"affix": true,
//               //"fullpage": true,
//               //"hidden": true,
//               "tag": "100+"
//             },
//             "component": "system/config"
//           },
//           {
//             "path": "/system/dept",
//             "name": "dept",
//             "meta": {
//               "title": "部门管理",
//               "icon": "jd-icon-organization",
//               "type": "menu"
//             },
//             "component": "system/dept"
//           },
//           {
//             "path": "/system/user",
//             "name": "user",
//             "meta": {
//               "title": "用户管理",
//               "icon": "el-icon-user-filled",
//               "type": "menu"
//             },
//             "component": "system/user"
//           },
//           {
//             "path": "/system/role",
//             "name": "role",
//             "meta": {
//               "title": "角色管理",
//               "icon": "el-icon-notebook",
//               "type": "menu"
//             },
//             "component": "system/role"
//           },
//           {
//             "path": "/system/dict",
//             "name": "dict",
//             "meta": {
//               "title": "字典管理",
//               "icon": "el-icon-document",
//               "type": "menu"
//             },
//             "component": "system/dict"
//           },
//           {
//             "path": "/system/table",
//             "name": "tableSetting",
//             "meta": {
//               "title": "表格列管理",
//               "icon": "el-icon-scale-to-original",
//               "type": "menu"
//             },
//             "component": "system/table"
//           },
//           {
//             "path": "/system/menu",
//             "name": "menu",
//             "meta": {
//               "title": "菜单管理",
//               "icon": "el-icon-fold",
//               "type": "menu"
//             },
//             "component": "system/menu"
//           },
//           {
//             "path": "/system/task",
//             "name": "task",
//             "meta": {
//               "title": "计划任务",
//               "icon": "el-icon-alarm-clock",
//               "type": "menu"
//             },
//             "component": "system/task"
//           },
//           {
//             "path": "/system/client",
//             "name": "client",
//             "meta": {
//               "title": "应用管理",
//               "icon": "el-icon-help-filled",
//               "type": "menu"
//             },
//             "component": "system/client"
//           },
//           {
//             "path": "/system/log",
//             "name": "log",
//             "meta": {
//               "title": "系统日志",
//               "icon": "el-icon-warning",
//               "type": "menu"
//             },
//             "component": "system/log"
//           }
//         ]
//     },
// ]

const routes = process.env.NODE_ENV === 'development' ? [...dashboardRoutes, ...devRoutes] : [...dashboardRoutes];

export default routes;
